package com.imu.purse.modules.trade.form;

import com.alibaba.fastjson.annotation.JSONField;
import com.imu.common.validator.group.AddGroup;
import com.imu.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
public class ConversionForm {
    //付款账号
    @JSONField(ordinal = 1)
    @NotBlank(message="付款账号不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value="付款账号", name="payAccount", required = true, example="13800000000")
    private String payAccount;

    @JSONField(ordinal = 2)
    @NotBlank(message="订单号不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "订单号", name="orderNo", required = true, example="201801010100111")
    private String orderNo;

    @JSONField(ordinal = 3)
    @ApiModelProperty(value = "imu金额", name="money", required = true, example="100")
    @NotNull(message="imu金额", groups = {AddGroup.class, UpdateGroup.class})
    @Min(value=1, message="交易余额必须大于0", groups = {AddGroup.class, UpdateGroup.class})
    private BigDecimal imuMoney;

    @JSONField(ordinal = 4)
    @ApiModelProperty(value = "GET金额", name="xlcMoney",required = true, example = "0.2")
    @NotNull(message="GET金额不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private BigDecimal xlcMoney;

    @JSONField(ordinal = 5)
    @ApiModelProperty(value = "描述", hidden = true)
    private String detail;

    @JSONField(ordinal = 6)
    @ApiModelProperty(value = "imu系统地址", hidden = true)
    private String imuUrl;

    @JSONField(ordinal = 7)
    @ApiModelProperty(value = "GET系统地址", hidden = true)
    private String xlcUrl;
}
